package jaxb;

import java.util.ArrayList;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;

public class Library {

	@XmlAttribute
	@XmlID	public String id;
	private String name;
	private String version;
	private String language;
	private String source;

	private ArrayList<String> dependencies;

	/**
	 * @param id
	 */
	public Library(String id) {
		this.id = id;
	}
	
	public Library() {}

	/**
	 * @param id
	 * @param name
	 * @param version
	 * @param language
	 * @param source
	 * @param developers
	 * @param dependencies
	 */
	public Library(String id, String name, String version, String language,
			String source,
			ArrayList<String> dependencies) {
		this.id = id;
		this.name = name;
		this.version = version;
		this.language = language;
		this.source = source;
		this.dependencies = dependencies;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		if (name != null) {
			this.name = name;
		} else {
			this.name = "";
		}
	}

	/**
	 * @return the version
	 */
	public String getVersion() {
		return version;
	}

	/**
	 * @param version
	 *            the version to set
	 */
	public void setVersion(String version) {
		if (version != null) {
			this.version = version;
		} else {
			this.version = "";
		}
	}

	/**
	 * @return the language
	 */
	public String getLanguage() {
		return language;
	}

	/**
	 * @param language
	 *            the language to set
	 */
	public void setLanguage(String language) {
		if (language != null) {
			this.language = language;
		} else {
			this.language = "";
		}
	}

	/**
	 * @return the source
	 */
	public String getSource() {
		return source;
	}

	/**
	 * @param source
	 *            the source to set
	 */
	public void setSource(String source) {
		if (source != null) {
			this.source = source;
		} else {
			this.source = "";
		}
	}
	
	
	
	@XmlIDREF
	public ArrayList<Developer> developers;


	/**
	 * @return the dependencies
	 */
	public ArrayList<String> getDependencies() {
		return dependencies;
	}

	/**
	 * @param dependencies
	 *            the dependencies to set
	 */
	public void setDependencies(ArrayList<String> dependencies) {
		this.dependencies = dependencies;
	}

}
